﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

/// <summary>
/// Summary description for D_
/// </summary>
namespace Bestlife.ERP.DataAccess
{
    public class D_Supplier
    {
        public D_Supplier()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public static Boolean insertsupp(Bestlife.ERP.Entities.E_Supplier sup,string user)//insert 
    {
       
        try
        {
           
            DateTime date = System.DateTime.Now;
     
            String connStr = ConfigurationManager.ConnectionStrings["BestlifeDBConnectionString"].ConnectionString;
            Bestlife.ERP.DataAccess.Connection.connect(connStr);//connection string pass to connection class

           
            string sql = "UPDATE [BestlifeDB_TEST].[dbo].[Tbl_Supplier] SET [Contact] ='"+sup.Contact1+"',[Sup_Name] ='"+sup.Sup_Name1+"',[Sup_Tel] ='"+sup.Sup_Tel1+"',[Sup_mob] ='"+sup.Sup_mob1+"',[Sup_fax] ='"+sup.Sup_fax1+"',[Sup_email] ='"+sup.Sup_email1+"',[Sup_web] ='"+sup.Sup_web1+"',[Sup_Add] ='"+sup.Sup_Add1+"',[User_Create] ='"+user+"',[Last_Modify] ='"+date+"' WHERE [Sup_ID] ='"+sup.Sup_ID1+"'";

            Boolean add = Bestlife.ERP.DataAccess.Connection.AddEditDel(sql);
            if (add)
            {
                
                return true;
            }
           
        }
        catch(Exception)
        {
        }
        return false;
        Connection.con.Close();
    }
}


    }
